import React, { PureComponent } from 'react'
import { Text, View,StyleSheet,ScrollView,Button, Dimensions,StatusBar, Alert } from 'react-native'

export default class index extends PureComponent {
    createTowButtonAlert=()=>{
        Alert.alert('警告标题','警告内容',[
            {
                text:'取消',
                onPress:()=>console.log('cancel'),
                style:'cancel'
            },
            {
                text:'确认',
                onPress:()=>console.log('ok'),
                style:'cancel'
            }
        ])
    }
    render() {
        return (
            <ScrollView>
                <View style={styles.container}>
                    <View style={[styles.itemBase]}><Text style={[styles.textBaseText]}> 付款码 </Text></View>
                    <View style={[styles.itemBase]}><Text style={[styles.textBaseText]}> 扫一扫 </Text></View>
                    <View style={[styles.itemBase]}><Text style={[styles.textBaseText]}> 付款码 </Text></View>
                    <View style={[styles.itemBase]}><Text style={[styles.textBaseText]}> 出行 </Text></View>
                </View>
                <View>
                    <Button title='两个按钮'
                        onPress={this.createTowButtonAlert}
                        color={'red'}
                    ></Button>
                </View>
            </ScrollView>
            
        )
    }
}
const styles=StyleSheet.create({
    container:{
        flexDirection:'row',
        flexWrap:'wrap'
    },
    itemBase:{
        justifyContent:'center',
        alignContent:'center',
        backgroundColor:'#00b38a',
        width:Dimensions.get('window').width/4,
        height:90,
        borderWidth:1,
        borderColor:'yellow',
        fontSize:30,
    },
    textBaseText:{
        textAlign:'center',
        fontSize:20
    }
})